<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8" />
		 <meta name="viewport" content="width=device-width,initial-scale=1.0">
		<title>新增发票抬头</title>
		<link href="css/index.css" rel="stylesheet" />
	</head>
	<body>
	<div class="wrapResend">
		<div class="headTitle">
		<img onclick="goback()" src="./img/leftArrow.jpg" />
		<p>重发电子发票</p>
       	</div>
		<p>
			<span>电子邮箱</span>
			<input class="inputMail" placeholder="请输入电子邮箱" />
		</p>
		<span class="explain">
			说明：请输入新邮箱后，再点击提交，系统会给您重新发送电子发票
		</span>
		<button class="submit" >提交</button>
	</div>
</body>
</html>
<script src="js/jquery.min.js"></script>
<script src="js/oldPublic.js"></script>
<script src="js/code.js"></script>
<script src="js/security.js"></script>
<script>
	var login_name = sessionStorage.getItem('login_name');
	var telphone = sessionStorage.getItem('telphone');
	var orgcode = sessionStorage.getItem('orgcode');
	var locationUrl = window.location.href;
	var email = locationUrl.split('?')[1].split('&')[0].split('=')[1];
	$('.inputMail').val(email)
	var apply_seqno = locationUrl.split('?')[1].split('&')[1].split('=')[1];
	console.log(email);
	$('.submit').click(function(){
		var inputMail = $('.inputMail').val();
		var reg = /^([a-zA-Z]|[0-9])(\w|\-)+@[a-zA-Z0-9]+\.([a-zA-Z]{2,4})$/;
		if(!reg.test(inputMail)){
			showWarn('请输入正确的邮箱');
			return;
		}
		$.ajax({
				type:"post",
				url:sessionStorage.getItem('ipconfig'),
				contentType: "application/json;charset=utf-8",
				data:JSON.stringify({data:encryptByDESModeEBC(JSON.stringify({"tag":"9107",'login_name':login_name,'telphone':telphone,'fpqqlsh':apply_seqno, 'email':email,'orgcode':orgcode }))}),
				success:function(data){
					console.log(data);
					if(data.result=='00'){
						$('.submit').attr('disabled','disabled');
						$('.submit').css('background','gray');
						showWarn('发送邮件成功！');
					}
				}
		});
	})
</script>


